/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package verins.beans;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author hectdx
 */
@Entity
@Table(name = "padronelectorallinea", schema = "verinscribe")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Padronelectorallinea.findAll", query = "SELECT p FROM Padronelectorallinea p"),
    @NamedQuery(name = "Padronelectorallinea.findByIdpadronelectorallinea", query = "SELECT p FROM Padronelectorallinea p WHERE p.idpadronelectorallinea = :idpadronelectorallinea"),
    @NamedQuery(name = "Padronelectorallinea.findByDni", query = "SELECT p FROM Padronelectorallinea p WHERE p.dni = :dni"),
    @NamedQuery(name = "Padronelectorallinea.findByNombre", query = "SELECT p FROM Padronelectorallinea p WHERE p.nombre = :nombre"),
    @NamedQuery(name = "Padronelectorallinea.findByObservacion", query = "SELECT p FROM Padronelectorallinea p WHERE p.observacion = :observacion")})
public class Padronelectorallinea implements Serializable {
    @Lob
    @Column(name = "firma")
    private byte[] firma;
    @Lob
    @Column(name = "huella")
    private byte[] huella;
    @Column(name = "apepaterno", length = 30)
    private String apepaterno;
    @Column(name = "apematerno", length = 30)
    private String apematerno;
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    
    @Column(name = "idpadronelectorallinea", nullable = false)
    @GeneratedValue(generator="verinscribe.padronelectorallinea_idpadronelectorallinea_seq",strategy=GenerationType.IDENTITY)
    private Integer idpadronelectorallinea;
    @Column(name = "dni", length = 20)
    private String dni;
    @Column(name = "nombre", length = 100)
    private String nombre;
    @Column(name = "observacion", length = 200)
    private String observacion;
    @JoinColumn(name = "idfirmante", referencedColumnName = "dni", nullable = false)
    @ManyToOne(optional = false)
    private Persona idfirmante;
    @JoinColumns({
        @JoinColumn(name = "numeropagina", referencedColumnName = "numeropagina", nullable = false),
        @JoinColumn(name = "idpadronelectoral", referencedColumnName = "idpadronelectoral", nullable = false)})
    @ManyToOne(optional = false)
    private Paginapadronelectoral paginapadronelectoral;

    public Padronelectorallinea() {
    }

    public Padronelectorallinea(Integer idpadronelectorallinea) {
        this.idpadronelectorallinea = idpadronelectorallinea;
    }

    public Integer getIdpadronelectorallinea() {
        return idpadronelectorallinea;
    }

    public void setIdpadronelectorallinea(Integer idpadronelectorallinea) {
        this.idpadronelectorallinea = idpadronelectorallinea;
    }

    public String getDni() {
        return dni;
    }

    public void setDni(String dni) {
        this.dni = dni;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getObservacion() {
        return observacion;
    }

    public void setObservacion(String observacion) {
        this.observacion = observacion;
    }

    public Persona getIdfirmante() {
        return idfirmante;
    }

    public void setIdfirmante(Persona idfirmante) {
        this.idfirmante = idfirmante;
    }

    public Paginapadronelectoral getPaginapadronelectoral() {
        return paginapadronelectoral;
    }

    public void setPaginapadronelectoral(Paginapadronelectoral paginapadronelectoral) {
        this.paginapadronelectoral = paginapadronelectoral;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idpadronelectorallinea != null ? idpadronelectorallinea.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Padronelectorallinea)) {
            return false;
        }
        Padronelectorallinea other = (Padronelectorallinea) object;
        if ((this.idpadronelectorallinea == null && other.idpadronelectorallinea != null) || (this.idpadronelectorallinea != null && !this.idpadronelectorallinea.equals(other.idpadronelectorallinea))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "verins.beans.Padronelectorallinea[ idpadronelectorallinea=" + idpadronelectorallinea + " ]";
    }

    public String getApepaterno() {
        return apepaterno;
    }

    public void setApepaterno(String apepaterno) {
        this.apepaterno = apepaterno;
    }

    public String getApematerno() {
        return apematerno;
    }

    public void setApematerno(String apematerno) {
        this.apematerno = apematerno;
    }

    public byte[] getFirma() {
        return firma;
    }

    public void setFirma(byte[] firma) {
        this.firma = firma;
    }

    public byte[] getHuella() {
        return huella;
    }

    public void setHuella(byte[] huella) {
        this.huella = huella;
    }
    
}
